using System;
using Fasm;

namespace ns24
{
	internal static class Class242
	{
		internal static readonly Random random_0 = new Random();

		private static string smethod_0()
		{
			return random_0.Next(1, 7) switch
			{
				1 => "ax", 
				2 => "bx", 
				3 => "cx", 
				4 => "dx", 
				5 => "di", 
				6 => "si", 
				_ => "ax", 
			};
		}

		private static string smethod_1()
		{
			return random_0.Next(1, 7) switch
			{
				1 => "eax", 
				2 => "ebx", 
				3 => "ecx", 
				4 => "edx", 
				5 => "edi", 
				6 => "esi", 
				_ => "eax", 
			};
		}

		private static void smethod_2(ManagedFasm managedFasm_0, int int_0)
		{
			if (int_0 <= 0)
			{
				return;
			}
			do
			{
				int_0--;
				string text = smethod_1();
				string text2 = smethod_0();
				switch (random_0.Next(1, 6))
				{
				case 5:
					managedFasm_0.AddLine("push {0}", text);
					managedFasm_0.AddLine("pop {0}", text);
					break;
				case 4:
					managedFasm_0.AddLine("push {0}", text2);
					managedFasm_0.AddLine("pop {0}", text2);
					break;
				case 3:
					managedFasm_0.AddLine("mov {0}, {0}", text2);
					break;
				case 2:
					managedFasm_0.AddLine("mov {0}, {0}", text);
					break;
				case 1:
				{
					for (int num = random_0.Next(1, 4); num > 0; num--)
					{
						managedFasm_0.AddLine("nop");
					}
					break;
				}
				}
			}
			while (int_0 > 0);
		}

		internal static void smethod_3(this ManagedFasm managedFasm_0, string string_0)
		{
			int num = random_0.Next(2, 5);
			int num2 = num / 2;
			smethod_2(managedFasm_0, num2);
			managedFasm_0.AddLine(string_0);
			smethod_2(managedFasm_0, num % 2 + num2);
		}

		internal static void smethod_4(this ManagedFasm managedFasm_0, string string_0, params object[] object_0)
		{
			int num = random_0.Next(2, 5);
			int num2 = num / 2;
			smethod_2(managedFasm_0, num2);
			managedFasm_0.AddLine(string_0, object_0);
			smethod_2(managedFasm_0, num % 2 + num2);
		}
	}
}
